From: Jonas Dreßler Date: Tue, 2 Jun 2020 14:16:36 +0000 (+0200) Subject: util: Remove unused class CloseButton X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~684^2^2~272 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=f0ee9cdcf86f9f44ad6cdc8a903474eedf98a824;p=gnome-shell.git util: Remove unused class CloseButton This looks like it was used to create the close buttons in the overview at some point, we're no longer using it nowadays though, so remove it. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1298 --- diff --git a/js/misc/util.js b/js/misc/util.js index c68604e87..314d7660f 100644 --- a/js/misc/util.js +++ b/js/misc/util.js @@ -1,9 +1,9 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- /* exported findUrls, spawn, spawnCommandLine, spawnApp, trySpawnCommandLine, formatTime, formatTimeSpan, createTimeLabel, insertSorted, - makeCloseButton, ensureActorVisibleInScrollView, wiggle */ + ensureActorVisibleInScrollView, wiggle */ -const { Clutter, Gio, GLib, GObject, Shell, St, GnomeDesktop } = imports.gi; +const { Clutter, Gio, GLib, Shell, St, GnomeDesktop } = imports.gi; const Gettext = imports.gettext; const Main = imports.ui.main; @@ -363,51 +363,6 @@ function insertSorted(array, val, cmp) { return pos; } -var CloseButton = GObject.registerClass( -class CloseButton extends St.Button { - _init(boxpointer) { - super._init({ - style_class: 'notification-close', - x_expand: true, - y_expand: true, - x_align: Clutter.ActorAlign.END, - y_align: Clutter.ActorAlign.START, - }); - - this._boxPointer = boxpointer; - if (boxpointer) - this._boxPointer.connect('arrow-side-changed', this._sync.bind(this)); - } - - _computeBoxPointerOffset() { - if (!this._boxPointer || !this._boxPointer.get_stage()) - return 0; - - let side = this._boxPointer.arrowSide; - if (side == St.Side.TOP) - return this._boxPointer.getArrowHeight(); - else - return 0; - } - - _sync() { - let themeNode = this.get_theme_node(); - - let offY = this._computeBoxPointerOffset(); - this.translation_x = themeNode.get_length('-shell-close-overlap-x'); - this.translation_y = themeNode.get_length('-shell-close-overlap-y') + offY; - } - - vfunc_style_changed() { - this._sync(); - super.vfunc_style_changed(); - } -}); - -function makeCloseButton(boxpointer) { - return new CloseButton(boxpointer); -} - function ensureActorVisibleInScrollView(scrollView, actor) { let adjustment = scrollView.vscroll.adjustment; let [value, lower_, upper, stepIncrement_, pageIncrement_, pageSize] = adjustment.get_values();